<script language="javascript">
function validate_form(thisform)
{
with (thisform)
{
	if (validate_required(txtcode,"Bạn chưa nhập mã khách hàng!")==false)
 	{txtcode.focus();return false;}
	if (validate_required(txtpass,"Bạn chưa nhập mật khẩu!")==false)
 	{txtpass.focus();return false;}
	
	if (validate_length(txtpass,"Mật khẩu từ 3 đến 20 ký tự!", 20, 3)==false)
 	{txtpass.focus();return false;}
	
    if (validate_required(txtrepass,"Xác nhận mật khẩu không được để trống!")==false)
 	{txtrepass.focus();return false;}
    if (validate_confirmpass(txtpass,txtrepass,"Xác nhận mật khẩu sai!")==false)
    {txtrepass.focus();return false;}
	
	if (validate_required(txthoten,"Bạn chưa nhập họ tên!")==false)
 	{txthoten.focus();return false;}
	
	if (validate_required(txtemail,"Bạn chưa nhập email!")==false)
 	{txtemail.focus();return false;}
	if (validate_email(txtemail,"Sai định dạng email!")==false)
 	{txtemail.focus();return false;}
	
	if (validate_required(txtdiachi,"Bạn chưa nhập địa chỉ!")==false)
 	{txtdiachi.focus();return false;}
	
	
}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td style="padding:10px">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td   width="6" height="6"><img src="images/j_crn_tl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_t_med.png" width="100%"></td>
            <td  width="6" height="6" ><img src="images/j_crn_tr_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/dot.png"></td>
            <td class="bg_title"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><img src="images/icon-48-menumgr.png" width="48" height="48" /></td>
                <td width="45%" class="mana_title"> Thêm tài khoản</td>
                <td width="50%" align="center">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="75%">&nbsp;</td>
                      <td class="icon_style"><a href="#" onclick="document.getElementById('submit').click()"><img src="images/icon-32-save.png" width="32" height="33"  border="0"/><br />
                      Cập nhật</a></td>
                      <td class="icon_style"><a href="#"><img src="images/icon-32-help.png" width="32" height="32"  border="0"/><br />
                      Tr&#7907; gi&uacute;p</a></td>
                    </tr>
                  </table>
                  </td>
              </tr>
            </table></td>
            <td width="1" background="images/dot.png"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="6" height="6" ><img src="images/j_crn_bl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_b_med.png" width="100%"></td>
            <td width="6" height="6" ><img src="images/j_crn_br_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="7"></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td   width="6" height="6"><img src="images/j_crn_tl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_t_med.png" width="100%"></td>
            <td  width="6" height="6" ><img src="images/j_crn_tr_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/dot.png"></td>
            <td bgcolor="#fbfbfb"><form id="frmdanhsach" name="frmdanhsach" method="post" action="index.php?progid=1&taikhoan=xuly" onsubmit="return validate_form(this);">
              <table width="100%" border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td valign="top" style="padding-left:15px; width:64%"><fieldset id="fieldsearch2" runat="server">
                  <legend style="font-size:14px; color: black" title="Search" class="title_field"><span class="title_field">Thông tin khách hàng</span></legend>
                  <table width="100%" border="0" cellspacing="3" cellpadding="3">
                  	  <tr>
                        <td align="right" class="bg_form_left">Mã khách hàng<span style="color:#f00"> * </span></td>
                        <td class="bg_form_right"><input name="txtcode" type="text" id="txtcode" maxlength="200" /><span style="color:#808080; font-style:italic"> (Nhập tên nhân viên nếu là Tam Nguyên) </span>  
                       
                        <span>
                        <?php 
							$sql=mysql_query("
											select *
											from
												tb_room
											
							
											");
						?>
                        	<select name="room"> 
                            	<option>--Chon phong ban-- </option>
                          <?php while($rs=mysql_fetch_array($sql)){?>
                                <option value="<?php echo $rs['room_id'];?>"><?php echo $rs['room_name'];?> </option>
                           <?php }?>
                            </select>
                        </span></td>
                       
                      </tr>
                      
                      <tr>
                        <td width="25%" align="right" class="bg_form_left">Mật khẩu <span style="color:#f00"> * </span> </td>
                        <td  class="bg_form_right">
                        	<input name="txtpass" type="password" id="txtpass" maxlength="45" />
                            <span style="margin-left:160px;">Chức vụ </span>
                            <span><input type="text" name="position" /> </span>
                        </td>
                        
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Nhắc lại mật khẩu<span style="color:#f00"> * </span></td>
                        <td  class="bg_form_right">
                        	<input name="txtrepass" type="password" id="txtrepass" maxlength="45" />
                        	<span style="margin-left:140px;">Phân quyền </span>
                            <span> 
                            	<select name="quyen">
                                	<option value="">--Chọn quyền-- </option>
                                	<option value="1">Nhân viên </option>
                                    <option value="2">Trưởng phòng </option>
                                    <option value="3">Giám đốc </option>
                                </select>
                            </span>
                        </td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Tên khách hàng (cá nhân/công ty) <span style="color:#f00"> * </span></td>
                        <td  class="bg_form_right"><input name="txthoten" type="text" id="txthoten" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Người đại diện</td>
                        <td  class="bg_form_right"><input name="txnguoidaidien" type="text" id="txthoten" />
                       		<span> &nbsp;Chức vụ </span>
                            <span style="margin-left:20px;"> &nbsp;<input name="txtchucvu" type="text" id="txtchucvu"  /></span>
                        </td>
                       
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Người phụ trách website</td>
                        <td  class="bg_form_right">
                        	<input name="nguoiphutrach" type="text" id="nguoiphutrach"  />
                        	<span> &nbsp;Số điện thoại </span>
                            <span> &nbsp;<input name="tel_nguoiphutrach" type="text" id="tel_nguoiphutrach"  /></span>
                        </td>
                      		
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Email chính <span style="color:#f00"> * </span></td>
                        <td class="bg_form_right"><input name="txtemail" type="text" id="txtemail" maxlength="200" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Email phụ</td>
                        <td class="bg_form_right"><input name="txtemailphu" type="text" id="txtemail" maxlength="200" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Địa chỉ <span style="color:#f00"> * </span></td>
                        <td  class="bg_form_right"><input name="txtdiachi" type="text" id="txtdiachi" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Điện thoại bàn </td>
                        <td class="bg_form_right"><input name="txtphone" type="text" id="txtphone" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Điện thoại di động</td>
                        <td class="bg_form_right"><input name="txtmobile" type="text" id="txtmobile" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Fax</td>
                        <td class="bg_form_right"><input name="txtfax" type="text" id="txtmobile" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Giấy CMND/GPKD</td>
                        <td class="bg_form_right"><input name="txtcmnn" type="text" id="txtmobile" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Ngày sinh</td>
                        <td class="bg_form_right"><input name="txtngaysinh" type="text" id="txtmobile" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Mã số thuế</td>
                        <td class="bg_form_right"><input name="txttax" type="text" id="txttax" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Website</td>
                        <td class="bg_form_right"><input name="txtwebsite" type="text" id="txtmobile" maxlength="45" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Số tài khoản ngân hàng</td>
                        <td class="bg_form_right"><input name="txtaccountbank" type="text" id="txtmobile" /></td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Tên chủ tài khoản</td>
                        <td class="bg_form_right"><input name="txtaccountbank_name" type="text" id="txtmobile" /></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top" class="bg_form_left">Nhóm</td>
                        <td class="bg_form_right">
                          <select name="listnhom" size="9" id="listnhom" style=width:250px>
                            <option value="1">Administrator</option>
                            <option value="2">Guest</option>
                          </select>
                          </td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left">Khóa</td>
                        <td align="left" >
                          <input type="radio" name="txtstatus" id="txtstatus" value="0" />
                          có
                          <input name="txtstatus" type="radio" id="txtstatus" value="1" checked="checked" />
                          không</td>
                      </tr>
                      <tr>
                        <td align="right" class="bg_form_left"><input type="submit" name="submit" id="submit" value="Cập nhật" /></td>
                        <td align="left" >
                          <input type="reset" name="Reset" id="button" value="Nhập lại" />
                        </td>
                      </tr>
                    </table>
                  </fieldset></td>
                 
                  
                </tr>
              </table>
              
                        </form>
            </td>
            <td width="1" background="images/dot.png"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="6" height="6" ><img src="images/j_crn_bl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_b_med.png" width="100%"></td>
            <td width="6" height="6" ><img src="images/j_crn_br_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</td>
  </tr>
</table>
